<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

use App\Http\Requests;
use App\Http\Controllers\Controller;
use App\Order;
use DB;

class OrderController extends Controller
{
    public function orderhistory(){
        $order=Order::orderBy("id","desc")->get();
        return view("orderHistory",["order"=>$order]);
    }
    public function del($id){
        $res=DB::table("orders")->where("id",$id)->delete();
        if($res){
            return redirect("orderhistory");
        }
    }
    public function home(){
      $order=Order::orderBy("id","desc")->get();
      return view("home",["order"=>$order]);
    }
}
